class Solution {
    public void moveZeroes(int[] nums) {
        int cur = 0;
        int dest = 0;
        while(cur < nums.length){
            if(nums[cur] != 0){
                swap(nums,cur,dest);
                cur ++;
                dest ++;
            }else{
                cur ++;
            }
        }
    }
    public void swap(int[]nums,int a,int b){
        int temp = nums[b];
        nums[b] = nums[a];
        nums[a] = temp;
    }
}